<include file="Public:header" />
<link rel="stylesheet" type="text/css" href="../Public/js/calendar/jscal2.css"/>
<link rel="stylesheet" type="text/css" href="../Public/js/calendar/border-radius.css"/>
<link rel="stylesheet" type="text/css" href="../Public/js/calendar/win2k.css"/>
<script type="text/javascript" src="../Public/js/calendar/calendar.js"></script>
<script type="text/javascript" src="../Public/js/calendar/lang/en.js"></script>
<script>  
$(document).ready(function() {   
	$('[fs]').inputDefault();
	
	/*
	province = $("select[name='province']").val();
	city = $("select[name='city']").val();
	town = $("select[name='town']").val();
	//alert(town);
	if(province && city == ''){
		loadRegion('province',2,'city','{:U('Ajax/getRegion')}');
	}else if(city && town == ''){
		loadRegion('city',3,'town','{:U('Ajax/getRegion')}');
	}
	*/
});  
</script>
<div class="main">
    <div class="box_tit">
        <h2>提货单列表</h2>
    </div>
    
	<div class="sc_tp m_t3">
    	<p><span class="f_l f_s2 f_w sc_tit">提货单搜索</span></p>
        <form method="post" action="{:U('Couponorder/index')}">
    	<p class="m_t1">
    		
    		<!--label class="" for="s_order_id"><font class="m_t8">订单编号：</font></label> <input type="text" name="s_order_id" id="s_order_id" title="订单编号" value="{$s_order_id}" class="ipa2"-->
    		
  			<label class="" for="s_number"><font class="m_t8">货券编号：</font></label> <input type="text" name="s_number" id="s_number" title="货券编号" class="ipa2" value="{$s_number}">

    		<label class="m_l1" for="s_type_id"><font class="m_t8">货券类型：</font></label> 
			<select name="s_type_id" id="s_type_id" class="ipa6">
				<option value="" selected="selected">不限货券类型</option>
				<volist name="type_list" id="mvo">
					<if condition="$key eq $s_type_id">   
					<option value="{$key}" selected="selected">
					<else />
					<option value="{$key}">
					</if>   
					{$mvo}
					</option>
				</volist>
			</select>

    		<label class="m_l1" for="s_mobile"><font class="m_t8">订购手机：</font></label> <input type="text" name="s_mobile" id="s_mobile" title="订购手机" value="{$s_mobile}" class="ipa2">

			<label class="m_l1" for="s_start_time"><font class="m_t8">订单时间：</font></label>
			<input type="text" name="s_start_time" title="下单开始时间" value="{$s_start_time|toDate='Y-m-d H:i'}" id="s_start_time" class="ipa2">
	        <script type="text/javascript">
	            Calendar.setup({
	                weekNumbers: true,
	                inputField : "s_start_time",
	                trigger    : "s_start_time",
	                dateFormat: "%Y-%m-%d %H:%M",
	                showTime: true,
	                minuteStep: 1,
	                onSelect   : function() {
	                	this.hide();
	                	//$("#s_start_time").next('label').hide();    	
	                }
	            });
	        </script>
	        <label class="" for="s_end_time"><font class="m_t8">~</font></label>
	        <input type="text" name="s_end_time" title="下单结束时间" value="{$s_end_time|toDate='Y-m-d H:i'}" id="s_end_time" class="ipa2">
	        <script type="text/javascript">
	            Calendar.setup({
	                weekNumbers: true,
	                inputField : "s_end_time",
	                trigger    : "s_end_time",
	                dateFormat: "%Y-%m-%d %H:%M",
	                showTime: true,
	                minuteStep: 1,
	                onSelect   : function() {
	                	this.hide();
	                	//$("#s_end_time").next('label').hide();    
	                }
	            });
	        </script>
    	</p>
    	
    	<p class="m_t1">
    		<label class="" for="province"><font class="m_t8">订单省份：</font></label>
    		<select name="province" id="province" class="ipa6" onchange="loadRegion('province',2,'city','{:U('Ajax/getRegion')}');">  				
				<option value="" selected class="defaultoption">不限省份</option>
		        <volist name="province_list" id="vo">
		        <option value="{$vo.id}" <notempty name="vo.check">selected="selected"</notempty> >{$vo.name}</option>
		        </volist>  
			</select>
			<label class="m_l1" for="city"><font class="m_t8">订单城市：</font></label>
			<select name="city" id="city" class="ipa6" onchange="loadRegion('city',3,'town','{:U('Ajax/getRegion')}');">
				<notempty name="city">
					<option value="{$city}" selected="selected" >{$city|getRegion}</option>
				<else />
					<option value="" selected class="defaultoption">不限城市</option>
				</notempty>
			</select>
			<label class="m_l1" for="town"><font class="m_t8">订单地区：</font></label>
			<select name="town" id="town" class="ipa6" >
				<notempty name="town">
					<option value="{$town}" selected="selected" >{$town|getRegion}</option>
				<else />
					<option value="" selected class="defaultoption">不限地区</option>
				</notempty>
			</select>
			
			<label class="m_l1" for="s_status"><font class="m_t8">订单状态：</font></label>
    		<select name="s_status" id="s_status" class="ipa6">
				<option value="" <eq name="s_status" value="">selected="selected"</eq>>不限状态</option>
				<option value="3" <eq name="s_status" value="3">selected="selected"</eq>>审核中</option>
				<option value="2" <eq name="s_status" value="2">selected="selected"</eq>>已发货</option>
				<option value="4" <eq name="s_status" value="4">selected="selected"</eq>>已审核</option>
				<option value="1" <eq name="s_status" value="1">selected="selected"</eq>>已取消</option>
	        </select>
			
			<label class="m_l1" for="s_merchant_id"><font class="m_t8">销售商：</font></label> 
			<select name="s_merchant_id" id="s_merchant_id" class="ipa6">
				<option value="" selected="selected">不限销售商</option>
				<volist name="merchant_list" id="mvom">
					<if condition="$key eq $s_merchant_id">   
					<option value="{$key}" selected="selected">
					<else />
					<option value="{$key}">
					</if>   
					{$mvom}
					</option>
				</volist>
			</select>
			
    	</p>
    	
    	<p class="m_t1">
    		<label class=""></label> 
    		<input type="submit" class="submit btn5 mr0" value="查  询">
		    <input type="submit" class="submit btn5" name="export" value="导  出">
    	</p>
    	
		</form>
    </div>
    
    <div class="list">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tbody>
            <tr class="nbg">
                <!-- th><input type="checkbox" id="check"></th -->
                <th>订单编号</th>
                <th>货券类型</th>
				<th>货券价格</th>
                <th>货券编号</th>
                <th>订购时间</th>
                <th>订购姓名</th>
                <th>订购手机</th>
                <th>订购地区</th>
                <th>状态</th>
                <th>来自</th>
                <th>操作</th>
            </tr>
            <volist name="list" id="vo">
            <tr>
                <!--td><input type="checkbox" name="key" value="{$vo.id}"></td-->
                <td><a href="{:U('Couponorder/edit',array('id'=>$vo['id']))}">{$vo.order_id}</a></td>
                <td>{$vo.coupon_id|getCouponType}货券</td>
				<td>{$vo.coupon_id|getCouponPrice}元</td>
                <td>{$vo.coupon_id|getCouponNumber}</td>
                <td>{$vo.create_time|toDate="y-m-d H:i"}</td>
                <td>{$vo.name}</td>
                <td>{$vo.mobile}</td>
                <td><a href="javascript:void(0)" title="{$vo.province|getRegion}|{$vo.city|getRegion}|{$vo.town|getRegion}|{$vo.address}">{$vo.city|getRegion}</a></td>
                <td>{$vo.status|getCouponorderStatus}&nbsp;|&nbsp;{$vo.coupon_id|getOrderCouponStatus}</td>
                <td><if condition="$vo.is_wap eq 0">网页<else/>手机</if></td>
                <td>
                    <if condition="$vo.status eq 2">
                    	<a href="{:U('Couponorder/over',array('id'=>$vo['id']))}">审核&nbsp;&nbsp;&nbsp;</a>
                    <elseif condition="$vo.status eq 3" />
                    	<a href="{:U('Couponorder/edit',array('id'=>$vo['id']))}">发货&nbsp;&nbsp;&nbsp;</a>  	
                    <elseif condition="$vo.status eq 0" />
                    	<a href="javascript:void(0);" class="gray" >已取消</a>
                    <else /> 
 						<a href="javascript:void(0);" class="gray">已发货</a>
                    </if>
                    &nbsp;&nbsp;&nbsp;
                    <a href="{:U('Couponorder/edit',array('id'=>$vo['id']))}">查看&nbsp;&nbsp;&nbsp;</a>
                    <neq name="vo.status" value="0">
                    &nbsp;&nbsp;&nbsp;
                    <a href="{:U('Couponorder/cancle',array('id'=>$vo['id']))}">取消&nbsp;&nbsp;&nbsp;</a>
                    <else/>
                    &nbsp;&nbsp;&nbsp;
                    <a href="{:U('Couponorder/nocancle',array('id'=>$vo['id']))}">恢复&nbsp;&nbsp;&nbsp;</a>
                    </neq>
                </td>
            </tr>
            </volist>
            </tbody>
        </table>
        <div class="th" style="clear: both;">{$page}</div>
    </div>
</div>
<include file="Public:footer" />